package com.test.websample.pojo;

import jakarta.validation.constraints.Pattern;
import lombok.Data;

@Data
public class Demo {
    @Pattern(regexp = "^[0-9]+$", message = "只能是数字", groups = {Group1.class, Group2.class})
    private String testStr;

    interface Group1 {}
    interface Group2 {}
}
